package com.itany.exchange.vo;

import com.itany.exchange.constant.ResponseStatusConstant;
import lombok.Data;

import java.io.Serializable;

/**
 * Author：汤小洋
 * Date：2019-12-19 11:03
 * Description：<描述>
 */
@Data
public class ResponseResult  implements Serializable {

    private Integer code;
    private String msg;
    private Object data;


    public static ResponseResult success(){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.SUCCESS);
        result.setMsg("success");
        return result;
    }

    public static ResponseResult success(Object data){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.SUCCESS);
        result.setMsg("success");
        result.setData(data);
        return result;
    }

    public static ResponseResult fail(String msg){
        ResponseResult result = new ResponseResult();
        result.setCode(ResponseStatusConstant.FAIL);
        result.setMsg(msg);
        return result;
    }
}
